package com.lims.dao.common.impl;

import java.util.List;


import com.lims.dao.base.BaseDAOImpl;
import com.lims.dao.common.ISampleTypeDAO;
import com.lims.po.common.SampleType;

public class SampleTypeDAOImpl extends BaseDAOImpl<SampleType> implements ISampleTypeDAO {
	private static final String className=SampleTypeDAOImpl.class.toString();
	public List<SampleType> selectAll(){
		String hql="from SampleType order by pid ";
		return super.ExecuteQuery(hql, className+"-->selectAll()");
	}
	public boolean saveSampleType(SampleType sampleType){
		return super.saveObject(sampleType, className+"-->saveSampleType(SampleType SampleType)")>0?true:false;
	}
	public boolean updateSampleType(SampleType sampleType){
		return super.updateObject(sampleType, className+"-->updateSampleType(SampleType SampleType)");
	}
	public boolean deleteSampleType(SampleType sampleType){
		return super.deleteObject(sampleType, className+"-->deleteSampleType(SampleType SampleType)");
	}
	public boolean deleteSampleTypeById(int pid){
		String hql="delete from SampleType where pid="+pid;
		return super.ExecuteNonQuery(hql, className+"-->deleteSampleTypeById(int pid)");
	}
	
	public SampleType selectSampleTypeById(int pid) {
		return super.selectById(pid, className+"-->selectSampleTypeById(int pid)");
	}
	public boolean selectSampleTypeBySampleTitle(String sampleType) {
		String hql="from SampleType where SampleTypeName='"+sampleType+"'";
		return super.ExecuteQuery(hql, className+"-->selectSampleTypeBySampleTypeName(String SampleTypeName)").size()==0?false:true;
	
	}
}
